CC = arm-none-eabi-gcc
LD = arm-none-eabi-ld
OBJCOPY = arm-none-eabi-objcopy
OBJDUMP = arm-none-eabi-objdump
 
CFLAGS = -O0 -g
ASFLAGS = -O0 -g
LDFLAGS = -T leeos.lds -Ttext 30000000 
 
OBJS = abnormal.o start.o init.o boot.o \
		mmu.o \
	   	printk.o \
	   	string.o \
	   	interrupt.o \
    	memory.o \
	   	storage.o \
	   	ram_disk.o \
 	   	file_system.o \
 	   	vfs.o \
	   	excute.o \
	   	os_system_call.o \
		proc.o
 
.c.o:
	$(CC) $(CFLAGS) -c $<
.s.o:
	$(CC) $(ASFLAGS) -c $<
 
leeos.elf:$(OBJS)
	$(CC) -static -nostartfiles -nostdlib $(LDFLAGS) $? -o $@
	$(OBJCOPY) -O binary $@ leeos.bin
	$(OBJDUMP) -S leeos.elf > leeos.dump
 
clean:
	rm -f *.o leeos.elf leeos.bin leeos.dump